package com.leoman.dao;

import com.leoman.entity.Broadcast;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

/**
 * BroadcastDao
 * Created by 涂奕恒 on 2016/11/23 0023 下午 3:42.
 */
public interface BroadcastDao extends JpaRepository<Broadcast, Integer>, JpaSpecificationExecutor<Broadcast> {

    @Query("select a from Broadcast a where a.isTop = 1")
    Broadcast iFindOneWithTop();

    @Query("select a from Broadcast a where a.isAdmin = 1")
    Broadcast iFindOneWithAdmin();
}